from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import logout
from django.conf import settings
from LPARReservation import views as views
from django.contrib.auth import views as auth_views
from django import views as django_views

admin.autodiscover()

urlpatterns = [
    # Examples:
    url(r'^lpars/', views.home, name='home'),
    url(r'^reserve/$', views.reserve, name='reserve'),
    url(r'^cancel/$', views.cancel, name='cancel'),
    url(r'^rsv/$', views.rsv, name='rsv'),
    url(r'^ccl/$', views.ccl, name='ccl'),
    url(r'^logout/', auth_views.logout, {'next_page': '/'}, name='logout'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('lbforum.urls')),
    url(r'^attachments/', include('lbattachment.urls')),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^site_media/(?P<path>.*)$', django_views.static.serve, {'document_root': settings.SITE_MEDIA_ROOT, 'show_indexes': True }),
    url(r'^static/(?P<path>.*)$', django_views.static.serve, {'document_root': settings.STATIC_ROOT,}),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
